//
//  OneDetailTableViewCell.m
//  BeautyClother
//
//  Created by dllo on 15/9/2.
//  Copyright (c) 2015年 宋爽. All rights reserved.
//

#import "OneDetailTableViewCell.h"

@interface OneDetailTableViewCell ()

@property (nonatomic, assign) CGFloat offWidth;
@property (nonatomic, assign) CGFloat offHeight;

@end

@implementation OneDetailTableViewCell


- (void)dealloc
{
    [_image release];
    [_title release];
    [_content release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.image = [[UIImageView alloc]init];
        [self.contentView addSubview:_image];
        [_image release];
        
        self.title = [[UILabel alloc]init];
        [self.contentView addSubview:_title];
        [_title release];
        
        self.content = [[UILabel alloc]init];
        [self.contentView addSubview:_content];
        [_content release];
        
        self.offWidth = [[UIScreen mainScreen]bounds].size.width / 375;
        self.offHeight = [[UIScreen mainScreen]bounds].size.height / 667;
        
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    _image.frame = CGRectMake(self.frame.size.width - 140*_offWidth, 10*_offHeight, 130*_offWidth, 130*_offHeight);
    _title.frame = CGRectMake(10*_offWidth, 5 *_offHeight, self.frame.size.width - 150*_offWidth, 70*_offHeight);
    _title.numberOfLines = 2;
    
    _content.frame = CGRectMake(10*_offWidth, 70*_offHeight, _title.frame.size.width, 80*_offHeight);
    _content.numberOfLines = 3;
    _content.textColor = [UIColor lightGrayColor];
    _content.font = [UIFont systemFontOfSize:14];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
